#include"share.hpp"


using namespace std;


#include<cstdio>

int main()
{

    int shmid = Getshmid();
    char* shaddr = (char*)shmat(shmid,nullptr,0);

    struct shmid_ds shmds;


    
    int ret = shmctl(Getshmid(),IPC_STAT,&shmds);
    cout << "权限: " << shmds.shm_perm.mode<<endl;
    cout << "共享内存大小: " << shmds.shm_segsz<<endl;
    cout << "创建共享内存的进程ID: " << shmds.shm_perm.mode<<endl;
    printf("共享内存的key值: 0x%x \n",shmds.shm_perm.__key);




    shmdt((void*)shaddr);

    return 0;
}